package tech.aichan.AiQA.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import tech.aichan.AiQA.model.entity.Permission;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PermissionMapper extends BaseMapper<Permission> {
    @Select("select permission.* from permission left join" +
            "    (select * from role_permission where role_id = #{id})" +
            "    as rp" +
            "    on permission.id = rp.permission_id")
    List<Permission> listPermissionByRoleId(Long id);
}
